package game.players;

import utils.Range;
import game.players.cpu.teammate.WithoutBallStationaryCPUMate;
import game.soccerField.Arc;

import com.uqbar.vainilla.appearances.Animation;
import com.uqbar.vainilla.appearances.Sprite;

public class SoccerPlayerCPUMate extends SoccerPlayerCPU {

	public SoccerPlayerCPUMate(double x, double y, Range areaX, Range areaY) {
		super(x, y, areaX, areaY);
		this.setState(new WithoutBallStationaryCPUMate(this));
	}
	
	public SoccerPlayerCPUMate(double x, double y, Range areaX, Range areaY, Arc rivalArc) {
		super(x, y, areaX, areaY);
		this.setRivalArc(rivalArc);
		this.setState(new WithoutBallStationaryCPUMate(this));
	}

	@Override
	public void setRightAnimationWithSpeed(double meanTime) {
		this.setAppearance(new Animation(meanTime,
				Sprite.fromImage("/images/goal3_caminando2.png").crop(47, 0, 34, 65).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(99, 0, 34, 64).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(143, 0, 34, 65).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(193, 1, 34, 65).scale(1.5)
				));
	}
	
	@Override
	public void setLeftAnimationWithSpeed(double meanTime) {
		this.setAppearance(new Animation(meanTime,
				Sprite.fromImage("/images/goal3_caminando2.png").crop(47, 0, 34, 65).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(99, 0, 34, 64).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(143, 0, 34, 65).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(193, 1, 34, 65).scale(1.5).flipHorizontally()
				));
	}

	@Override
	public boolean isUserMate() {
		return true;
	}

	@Override
	public boolean isGoalKeeper() {
		return false;
	}

	@Override
	public void throwOutTheBall() {
		//un compañero no puede tirar la pelota afuera		
	}
}
